-
Notifications
You must be signed in to change notification settings - Fork 78
PDPDEVTOOL-6272: Create UI to provide Feedback Loop for DevAssist #971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PDPDEVTOOL-6272: Create UI to provide Feedback Loop for DevAssist #971
Conversation
…op-UI # Conflicts: # packages/vscode-extension/messages.json # packages/vscode-extension/src/service/TranslationKeys.ts
packages/vscode-extension/src/startup/DevAssistConfiguration.ts
Outdated
Show resolved
Hide resolved
| ] | ||
|
|
||
| let feedbackFormPanel: vscode.WebviewPanel | undefined; | ||
| let vscodeExtensionMediaPath : string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to have a service that can get the html content instead of constructing the path each time. It will make the implementation cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented a MediaFileService (naming could be improved).
It mostly does what we discussed, the only limitation being that CSS file paths must be relative to the VSCode.WebView. Therefore, the cssUri must be calculated on the WebViewController and passed to the MediaFileService.
|
|
||
| // Handle messages/events sent from the webview | ||
| feedbackFormPanel.webview.onDidReceiveMessage( | ||
| (webviewMessage) => handleWebviewMessage(webviewMessage, feedbackFormCSSFilePath), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would prefer webviewEvent instead of webviewMessage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| return true; | ||
| } | ||
|
|
||
| const handleWebviewMessage = async (webviewMessage : any, feedbackFormCSSFilePath : string) : Promise<void> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets try to shape the webviewMessage/webviewEvent with a proper type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| } catch (error) { | ||
| // VSCODE ERROR, PROXY_NOT_LOADED, PROXY_ERROR, REQUEST_FORMATING_ERROR (Not even a response received) | ||
| vsLogger.printTimestamp(); | ||
| vsLogger.error(translationService.getMessage(DEVASSIST_SERVICE.FEEDBACK_FORM.SUBMITTING_ERROR_TOAST, error ? '\n' + error : '')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be the internal error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guess I copied/pasted too quickly.
Solved
On Code Review:
Missing from the code review